home *** CD-ROM | disk | FTP | other *** search
- Path: mcrware.microware.com!jejones
- From: jejones@microware.com (James Jones)
- Newsgroups: comp.lang.c++
- Subject: well-chosen overloading (was Re: Will Java kill C++?)
- Date: 5 Mar 1996 21:33:29 GMT
- Organization: Microware Systems Corp., Des Moines, Iowa
- Message-ID: <4hibv9$8bu@mcrware.microware.com>
- References: <313613B2.136E@ksopk.sprint.com> <4h554t$9jk@netline-fddi.jpl.nasa.gov> <4h8ka3$4o8@atlas.tus.ssi1.com>
- NNTP-Posting-Host: mork.microware.com
-
- In article <4h8ka3$4o8@atlas.tus.ssi1.com> Mike Palmer <Mike.Palmer@tus.ssi1.com> writes:
- >Although I could use overloaded operators to create a language that
- >only I understand, if they are used in an intelligent and judicious
- >manner, they can enhance the readability of code significantly, even
- >for someone who doesn't know beans about your classes.
-
- What would be good rules for intelligent and judicious use? It's not a
- rhetorical question; I really would like to know. For example, I've always
- wondered why the stream output operator isn't += (-= for input); also, the
- existing operators, which are all that one can use as operators in C++,
- carry connotations with them that may be misleading.
-
- (Come to think of it, while I'm asking about streams, it's obviously a
- a good idea to write
-
- cout << (i << j);
-
- to output the result of shifting i left j bits, but is it necessary?)
-
- James Jones
-
- Opinions herein are those of the author, and not necessarily those of any
- organization.
-